<?php 
if (COUNT($_POST) > 0)
{
	$term = $this->get('term');
	$type = $this->get('type');
	$sql = "SELECT aid , CONCAT(first_name, ' ' ,last_name) as val, institution, address, email, contact FROM login WHERE type=$type AND (first_name LIKE '%$term%' OR last_name LIKE '%$term%' OR institution LIKE '%$term%') ORDER BY val;";
	Connection::getConnect();
	Connection::setQuery($sql);
	$result = Connection::fetchAll(MYSQL_ASSOC);
	foreach ($result as $c)
	{
		echo '<tr class="ease list searches" aid="' . $c['aid'] . '">';
		echo '	<td style="width:200px">' . $c['val'] . '</td>';
		echo '	<td style="width:200px">' . $c['institution'] . '</td>';
		echo '	<td style="width:100px">' . $c['email'] . '</td>';
		echo '	<td style="width:150px">' . $c['address'] . '</td>';
		echo '	<td style="width:150px">' . $c['contact'] . '</td>';
		echo '</tr>';
	}
	exit;
}
?>
